package com.changgou;

import com.changgou.entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import tk.mybatis.spring.annotation.MapperScan;

import javax.persistence.Id;

/**
 * @ClassName SeckillApplication
 * @Description 秒杀服务
 * @Author 洛尘
 * @Date 16:15 2019/11/27
 * @Version 2.1
 **/
@SpringBootApplication
@EnableEurekaClient
@MapperScan(basePackages = {"com.changgou.seckill.dao"})
@EnableScheduling //开启定时任务
@EnableAsync      // 开启多线程任务
public class SeckillApplication {

    public static void main(String[] args) {
        SpringApplication.run(SeckillApplication.class , args);
    }

    @Bean
    public IdWorker idWorker(){
        return  new IdWorker(1,1);
    }

}
